#ifndef YCEXTENSIONVIEW_H
#define YCEXTENSIONVIEW_H
#include "extensiontype.h"
#include <QFrame>
#include <QJsonValue>
#include <QPointer>

namespace yc {

class Extension;

class YCEXTENSIONSHARED_EXPORT ExtensionView : public QFrame
{
    Q_OBJECT

public:
    explicit ExtensionView(Extension* extension, QWidget* parent = nullptr);

    Extension* extension() const;

    virtual QJsonValue saveState() const { return QJsonValue(); }
    virtual void restoreState(const QJsonValue& state) { Q_UNUSED(state) }
    virtual void onWindowStateChanged(Qt::WindowStates state, Qt::WindowStates old_state)
    {
        Q_UNUSED(state)
        Q_UNUSED(old_state)
    }

private:
    QPointer<Extension> extension_;
};

} // namespace yc

#endif // YCEXTENSIONVIEW_H
